//
//  NSDate+Extension.m
//  nncloud
//
//  Created by gdy on 2018/9/28.
//  Copyright © 2018年 youedata. All rights reserved.
//

#import "NSDate+Extension.h"

@implementation NSDate (Extension)


//时间戳转成时间
+ (NSString *)timeTransfer:(NSString *)timeStampString {
    //    NSString *timeStampString  = @"1495453213000";
    // iOS 生成的时间戳是10位
    NSTimeInterval interval =[timeStampString doubleValue]/1000.0;
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd HH:mm"];
    NSString *dateString = [formatter stringFromDate: date];
    return dateString;
    
}

@end
